<?php
/**
Extension Name: Low-Cal Vanilla
Extension Url: http://lussumo.com/addons/index.php?PostBackAction=AddOn&AddOnID=315
Description: [experimental] Gunzip Vanilla pages.
Version: 0.5.2
Author: Damien Lebrun
Author Url: http://lussumo.com/community/account/2469/
 *
 * @copyright @@AUTHOR@@ @@YEAR@@
 * @package Extensions
 * @subpackage Low-Cal_Vanilla
 * @license  @@LICENCE_URL@@ @@LICENCE@@
 *
 * $Id: default.php 336 2008-11-03 10:43:51Z dinoboff $
 * $HeadURL: http://vanilla-friends.googlecode.com/svn/extensions/LowCalVanilla/tags/LowCalVanilla-0.5.2/default.php $
 */

if (!defined('IN_VANILLA')) exit();

define('LOWCALVANILLA_DIR', dirname(__FILE__));
include_once(LOWCALVANILLA_DIR . '/library/Control.CompressPage.php');
include_once(LOWCALVANILLA_DIR . '/library/Functions.php');

/**
 * @global Context $Context
 * @global array $Configuration
 */
global $Context, $Configuration;

// Install default setting value.
LowCalVanilla_Install($Context, '0.5.2', LOWCALVANILLA_DIR);

// Replace the 4 core script by a packed one
if ($Configuration['LOWCALVANILLA_PACKER_ENABLE']) {
	$Context->AddToDelegate('Head',
		'PreRender',
		'LowCalVanilla_PackJsFiles');
}

// Compress the output of the page
if ($Configuration['LOWCALVANILLA_GZIP_ALLOWED']) {
	// add Low-Cal Vanilla control. Should be the last control to render.
	$LowCalVanilla = new LowCalVanilla_CompressPage($Context);
	$Page->AddControl('Page_Unload', $LowCalVanilla, '1000');
}

// Let the CleanUp Controll that the extension is loaded
$Context->PassThruVars['LOWCALVANILLA_LOADED'] = 1;

